/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package json;

/**
 *
 * @author Alexx
 */
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.apache.log4j.Logger;

public class JsonSerializer
{
  private static final Logger log = Logger.getLogger(JsonSerializer.class);
  private JSONParser parser;
  private JSONObject jsonObj;
  
  public JsonSerializer()
  {
    JSONParser parser = new JSONParser();
    this.parser = parser;   
  }
  
  public void startGet(String str) throws ParseException{
    log.debug("Json str" + str);
    Object obj = parser.parse(str);
    jsonObj = (JSONObject) obj;
  }
  
  public String getString(String str)
  {
    String name = (String) jsonObj.get(str);
    return name;
  }
  
}
